package com.dell.chen.dao.impl;

import com.dell.chen.dao.AdminDao;
import com.dell.chen.pojo.Admin;

/**
 * @author ：ChenwithIU
 * @date ：Created in 2020/11/28 9:46
 */
public class AdminDaoImpl extends BaseDao implements AdminDao {


    @Override
    public Admin queryByUsernameAndPassword(String username,String password) {
        String sql = "select `username`,`password` from f_admin where `username`=? and `password`=?";
        return queryForOne(Admin.class,sql,username,password);
    }

    @Override
    public int updatePassword(String newPassword,String password) {
        String sql = "update f_admin set `password`= ? where `password` = ?" ;
        return update(sql,newPassword,password);
    }
}
